* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #5880d3;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .hamburger {
    position: relative;
    width: 100px;
    height: 75px;
    cursor: pointer;
  }
  
  .hamburger .bar {
    display: inline-block;
    width: 100%;
    height: 12px;
    background-color: #fdfcff;
    border-radius: 3px;
    position: absolute;
    top: calc(50% - 6px);
    left: 0;
    transition: all 0.6s;
    animation-duration: 0.6s;
    animation-fill-mode: forwards;
  }
  
  .hamburger span:first-child {
    transform: translateY(-31.5px);
    animation-name: rotate-base-1;
  }
  .hamburger.active span:first-child {
    animation-name: rotate-1;
  }
  
  .hamburger span:last-child {
    transform: translateY(31.5px);
    animation-name: rotate-base-2;
  }
  .hamburger.active span:last-child {
    animation-name: rotate-2;
  }
  
  .hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
  }
  
  /* Let's create the animations */
  @keyframes rotate-1 {
    0% {
      transform: translateY(-31.5px);
    }
    50% {
      transform: translateY(0);
    }
    100% {
      transform: rotate(-45deg);
    }
  }
  @keyframes rotate-base-1 {
    0% {
      transform: translateY(0) rotate(-45deg);
    }
    50% {
      transform: rotate(0deg);
    }
    100% {
      transform: translateY(-31.5px);
    }
  }
  
  @keyframes rotate-2 {
    0% {
      transform: translateY(31.5px);
    }
    50% {
      transform: translateY(0);
    }
    100% {
      transform: rotate(45deg);
    }
  }
  @keyframes rotate-base-2 {
    0% {
      transform: translateY(0) rotate(45deg);
    }
    50% {
      transform: rotate(0deg);
    }
    100% {
      transform: translateY(31.5px);
    }
  }